﻿CREATE TABLE [dbo].[order_deal] (
    [ID]             INT             IDENTITY (1, 1) NOT NULL,
    [OrderNo]        VARCHAR (255)   NOT NULL,
    [CustomerID]     INT             NOT NULL,
    [NoteDate]       DATETIME        NOT NULL,
    [OperatorUserID] INT             NOT NULL,
    [CreatedOn]      DATETIME        NOT NULL,
    [TotalMoney]     DECIMAL (18, 5) NOT NULL,
    [Method]         INT             CONSTRAINT [DF__order_dea__Metho__10566F31] DEFAULT ('0') NOT NULL,
    [Delivers]       NVARCHAR (200)  NULL,
    [OrderStatus]    INT             NOT NULL,
    [Description]    NVARCHAR (500)  NULL,
    CONSTRAINT [PK__order_de__3214EC270C85DE4D] PRIMARY KEY CLUSTERED ([ID] ASC),
    CONSTRAINT [FK_order_deal_customers] FOREIGN KEY ([CustomerID]) REFERENCES [dbo].[customers] ([ID]),
    CONSTRAINT [FK_order_deal_users] FOREIGN KEY ([OperatorUserID]) REFERENCES [dbo].[users] ([ID])
);





